package com.study.designPattern.create.factory;

/**
 * @author ysy
 * @version 1.0
 * @Title: CarFactory
 * @Note <b>ProjectName:</b> Pre-research
 * <br><b>PackageName:</b> com.study.designPattern.create.factory
 * <br><b>ClassName:</b>
 * <br><b>Date:</b>

 */
public class CarFactory {

    // 工厂类
    public ICar getCar(String brandName){
        if(brandName == null){
            return null;
        }
        if("Benz".equals(brandName)){
            return new Benz();
        }else if("Honda".equals(brandName)){
            return new Honda();
        }
        return null;
    }
}
